<!DOCTYPE html>
<html lang="" style="min-width: 1280px">

<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta name="google" value="notranslate" />
	<link rel="shortcut icon" href="#" />
	<!-- <script type="text/javascript" src="./js/getThemeCss.js"></script> -->
	<!-- <script>
		let tenantDetail = JSON.parse(localStorage.getItem('tenantDetail'))
		let theme =
			tenantDetail && tenantDetail.data
				? tenantDetail.data.navigation_bg || 'blue'
				: 'blue'
		const mapper = {
			'#306EFF': 'blue',
			'#224585': 'darkblue',
			'#CE3B43': 'gray',
			'#06BE87': 'green',
			'#EF762F': 'orange',
		}
		let themeVar = theme
		if (theme.substr(0, 1) === '#') {
			themeVar = mapper[theme]
		}
		const link = document.createElement('link')
		link.setAttribute('type', 'text/css')
		link.setAttribute('rel', 'stylesheet')
		link.setAttribute(
			'href',
			'<%= VUE_APP_CDN_PATH %>/lib/byteluck-theme/0.1.12/byteluck.theme.' +
			themeVar +
			'.ant.css?t=<%= new Date().getTime() %>'
		)
		document.head.appendChild(link)

		const setBodyVisible = function () {
			try {
				document.body.style.visibility = 'visible'
			} catch (e) {
				return void setTimeout(setBodyVisible, 50)
			}
		}

		link.onload = function () {
			if (document.body) {
				document.body.style.visibility = 'visible'
			} else {
				void setBodyVisible()
			}
		}
		link.onreadystatechange = function () {
			if ('complete' === link.readyState) {
				document.body.style.visibility = 'visible'
			}
		}
	</script> -->
	<!-- <script src="https://byteluck.oss-cn-beijing.aliyuncs.com/libs/dayjs/dayjs.min.js"></script>
	<script src="https://byteluck.oss-cn-beijing.aliyuncs.com/libs/dayjs/customParseFormat.js"></script>
	<script src="https://byteluck.oss-cn-beijing.aliyuncs.com/libs/dayjs/weekday.js"></script>
	<script src="https://byteluck.oss-cn-beijing.aliyuncs.com/libs/dayjs/localeData.js"></script>
	<script src="https://byteluck.oss-cn-beijing.aliyuncs.com/libs/dayjs/weekOfYear.js"></script>
	<script src="https://byteluck.oss-cn-beijing.aliyuncs.com/libs/dayjs/weekYear.js"></script>
	<script src="https://byteluck.oss-cn-beijing.aliyuncs.com/libs/dayjs/advancedFormat.js"></script> -->

	<script>
		const hash = window.location.hash.split('?')[0]
		if (localStorage.tenantDetail) {
			let tenantDetail = JSON.parse(localStorage.tenantDetail)
			if (tenantDetail.data.tenant_auth && tenantDetail.data.tenant_auth.app_launcher && window.parent === window && ['#/home', '#/', ''].includes(hash)) {
				// window.location.replace('http://localhost:8081/desktop/multipleTabs')
				// window.location.replace('<%= VUE_APP_BASE_PATH %>/apps/desktop/multipleTabs')
			}
		}


		// ok-wc-ui 全局配置
		let options = {}
		// sourceHost
		let sourceHost = '<%= VUE_APP_SOURCE_HOST %>'
		if ('<%= NODE_ENV %>' !== 'development') {
			sourceHost = location.origin
		}

		// 国际化
		const cookies = document.cookie
			.split(';')
			.map(v => v.split('='))
			.find(v => v[0].trim() === 'local')
		const locale = cookies ? cookies[1] : 'zh-CN'

		// ok-wc-ui的全局配置
		window.okuiConfig = {
			env: '<%= NODE_ENV %>' === 'development' ? 'DEV' : 'PRD',
			apiPath: '<%= VUE_APP_OK_API_PATH %>',
			options: options,
			cardPath: '<%= VUE_APP_CARD_PATH %>',
			locale: locale, // 国际化
		}
	</script>
	<script>
		const cdnJSON = JSON.parse('<%= htmlWebpackPlugin.options.cdnJSON %>')
		// 获取主题方法
		const getTheme = <%= htmlWebpackPlugin.options.getTheme %>;
		// 获取主题颜色
		const { themeColor } = getTheme('<%= VUE_APP_CDN_PATH %>', cdnJSON['byteluck-theme']['folderPath'])
	</script>
	<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
		<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
		<% } %>
			<script src="<%= htmlWebpackPlugin.options.okI18n %>" data-base-url="<%= BASE_URL %>locales/"
				data-locale-key="locale" data-env="<%= NODE_ENV %>"></script>
			<style>
				body {
					overflow: overlay;
					background: var(--bl-n150-c);
				}
			</style>
</head>

<body style="visibility: hidden">
	<noscript>
		<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
				properly without JavaScript enabled. Please enable it to
				continue.</strong>
	</noscript>
	<div id="app"></div>
	<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
		<script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
		<% } %>
			<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.asyncJs) { %>
				<script async type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.asyncJs[i] %>"></script>
				<% } %>
</body>

</html>
